/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * DensityPanel.java
 *
 * Created on 7-okt-2009, 20:37:40
 */
package gui;

import flowvis.DensityRenderer;

/**
 *
 * @author michel
 */
public class DensityRendererPanel extends javax.swing.JPanel {

    DensityRenderer renderer;

    /** Creates new form DensityPanel */
    public DensityRendererPanel(DensityRenderer renderer) {
        initComponents();
        this.renderer = renderer;
        coloringCombobox.setSelectedIndex(renderer.getColoring());
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        coloringCombobox = new javax.swing.JComboBox();

        coloringCombobox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Grey scale", "Rainbow", "Rainbow (banded)", "Black body", "Black body (banded)" }));
        coloringCombobox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                coloringComboboxActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(coloringCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(262, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(coloringCombobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(269, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void coloringComboboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_coloringComboboxActionPerformed
        renderer.setColoring(coloringCombobox.getSelectedIndex());
    }//GEN-LAST:event_coloringComboboxActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox coloringCombobox;
    // End of variables declaration//GEN-END:variables
}
